/**
 *
 */

var changeDropDownBtnValue = function (text, btnId, val) {
    // console.log(text);
    $("#" + btnId).html(text + '<span class="caret" style="margin-left:0.5em"></span>');
    if (val != null) {
        $("#" + btnId).val(val);
    }
}
// 根据网址拿到字典数据
var getRequest = function () {
    var url = location.search; //获取url中"?"符后的字串
    var theRequest = new Object();
    if (url.indexOf("?") != -1) {
        var str = url.substr(1);
        var strs = str.split("&");
        for (var i = 0; i < strs.length; i++) {
            theRequest[strs[i].split("=")[0]] = strs[i].split("=")[1];
        }
    }
    request = theRequest;
    return request;
};
var t;
var showTip = function (t1, t2, t3, callback) {
    // 如果没有显示
    t1 = t1 != undefined ? t1 : 'Error...';
    t2 = t2 != undefined ? parseInt(t2) : 2500;
    var tip = '<div class="HTooltip shake animated"' +
        ' style="width:280px;padding:10px;text-align:center;background-color:#D84C31;color:#fff;position:fixed;top:100px;left:50%;z-index:100001;margin-left:-150px;box-shadow:1px 1px 5px #333;-webkit-box-shadow:1px 1px 5px #333;">' + t1 + '</div>';
    if (t3 == true && t3 != undefined) {
        tip = '<div class="HTooltip bounceInDown animated"' +
            ' style="width:280px;padding:10px;text-align:center;background-color:#5cb85c;color:#fff;position:fixed;top:100px;left:50%;z-index:100001;margin-left:-150px;box-shadow:1px 1px 5px #333;-webkit-box-shadow:1px 1px 5px #333;">' + t1 + '</div>';
    }
    $('.HTooltip').remove();
    $('body').stop().append(tip);
    if (t != null) {
        clearTimeout(t);
    }
    t = setTimeout(function () {
        $('.HTooltip').remove();
        if (callback != undefined) {
            methods.fire.call(this, callback);
        } //隐藏后的回调方法
    }, t2);
}
